#include<iostream>
using namespace std;
#include<vector>
class Solution {
public:
    vector<vector<int> > threeSum(vector<int>& nums) {
        vector<vector<int> > ans;
        int i=nums.size();
        for(int x=0;x<i;++x)
        {
            for(int y=x+1;y<i;y++)
            {
                for(int z=y+1;z<i;++z)
                {
                    int n=0;
                    if(nums[x]+nums[y]+nums[z]==0)
                    ans[n].push_back(x);
                    ans[n].push_back(y);
                    ans[n].push_back(z);
                    ++n;
                }
            }
        }
        return ans;
    }
};
//nums = [-1,0,1,2,-1,-4]
int main()
{
    vector<int> nums;
    nums.push_back(-1);
    nums.push_back(0);
    nums.push_back(1);
    nums.push_back(2);
    nums.push_back(-1);
    nums.push_back(-4);
    vector<vector<int> > ans=Solution::threeSum(nums);
   
 
    return 0;
}